using Digitalmes.Application.Scada.Models;

namespace Digitalmes.Application.Services;

/// <summary>
/// 数据同步服务。
/// </summary>
public interface IRemoteSynchronousService : IApplicationProvider
{
    /// <summary>
    /// 推送数据。注意，同一数据不要重复推送。
    /// </summary>
    /// <param name="output"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task PushAsync(OutboundOutput output, CancellationToken cancellationToken = default);

    /// <summary>
    /// 重新推送数据
    /// </summary>
    /// <param name="syncRemoteId">同步记录 Id。</param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task RetryAsync(long syncRemoteId, CancellationToken cancellationToken = default);

    /// <summary>
    /// 推送待同步的数据。
    /// </summary>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task PushReadyAsync(CancellationToken cancellationToken = default);

    /// <summary>
    /// 推送同步失败的数据。
    /// </summary>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task PushFailureAsync(CancellationToken cancellationToken = default);
}
